<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'allLock.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>


     <!-- 重新把Continue设置为0 在外面的forEach可继续遍历 -->
	 <c:set var="Continue" value="0"/>
     <c:forEach items="${requestScope.rooms}" var="room" varStatus="id">
     	${room.rApartment}:${room.rNum}
     	<c:forEach items="${requestScope.locks}" var="lock" varStatus="id">
     		<!-- 拿出锁状态 -->
   			<c:if test="${lock.lockid==room.rL}">
   				<form action="OpenLockHandler/openlock" method="get">
   					<input name="lock" type="text" value="${lock.lockid}" readonly="readonly">
	   				<input name="lockState" type="text" value="${lock.lCondition}" readonly="readonly">
		   			<c:if test="${lock.lCondition}">
		  			开	<br>
		  			</c:if>
			   		<c:if test="${!lock.lCondition}">
			   		关
			   		<input type="submit" value="开">	<br>
			   		</c:if>
		   		</form>
	   			<!-- 把Continue设置为1 直接跳出当前forEach 类似continue -->
				<c:set var="Continue" value="1"/>
   			</c:if>

     	</c:forEach>

     </c:forEach>

  </body>
</html>
